package com.thoughtworks.trains;



public class TrainsTest {

	
	public static void main(String[] args) {
		
		Town A = new Town("A");
		Town B = new Town("B");
		Town C = new Town("C");
		Town D = new Town("D");
		Town E = new Town("E");
		
		TownsMap map = new TownsMap(10);
		map.addTown(A);
		map.addTown(B);
		map.addTown(C);
		map.addTown(D);
		map.addTown(E);
		map.addRoute(A, B, 5);
		map.addRoute(B, C, 4);
		map.addRoute(C, D, 8);
		map.addRoute(D, C, 8);
		map.addRoute(D, E, 6);
		map.addRoute(A, D, 5);
		map.addRoute(C, E, 2);
		map.addRoute(E, B, 3);
		map.addRoute(A, E, 7);
		
		IRouteService routeService = map.getRouteService();
		
		System.out.println("A-B-C :"+routeService.getDistance("A","B","C"));
		System.out.println("A-D :"+routeService.getDistance("A","D"));
		System.out.println("A-D-C :" +routeService.getDistance("A","D","C"));
		System.out.println("A-E-B-C-D :"+routeService.getDistance("A","E","B","C","D"));
		System.out.println("A-E-D :"+routeService.getDistance("A","E","D"));
		
		System.out.println("trips start C to C : "+routeService.findRouteWithMax("C", "C", 3));
		System.out.println("trips start C to C : "+routeService.findRouteWithMax("A", "C", 3));
		
	}
	
	

}
